<template>
  <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal">
    <el-menu-item index="1" @click="navigateTo('/Home')">首页</el-menu-item>
    <el-menu-item index="2" @click="navigateTo('/Restaurants')">餐厅</el-menu-item>
    <el-menu-item index="3" @click="navigateTo('/User')">用户信息</el-menu-item>
  </el-menu>
</template>

<script>
export default {
  data() {
    return {
      activeIndex: '1'
    }
  },
  methods: {
    navigateTo(route) {
      this.$router.push(route);
    }
  }
}
</script>

<style scoped>
.el-menu-demo {
  background-color: #fffefb;
  color: #151514;
}
</style>